package com.ruoyi.project.relation.service;

import java.util.List;

import com.ruoyi.project.relation.domain.dto.BusinessRelationDO;
import org.shoukaiseki.common.function.TwoNoFunction;
import java.util.function.Function;
import com.ruoyi.project.relation.domain.BusinessLink;
import com.ruoyi.project.relation.domain.qo.BusinessLinkQO;
import org.springframework.transaction.annotation.Transactional;

/**
 * 业务链路Service接口
 *
 * @author wb
 * @date 2021-03-28
 */
public interface IBusinessLinkService
{


    /**
     * 添加链路,如果父级有多条链路则也会根据链路增加
     * @param currentBusiness
     * @param parentBusiness
     * @return
     */
    public void addLink(BusinessRelationDO currentBusiness, BusinessRelationDO parentBusiness);

    /**
     * 添加自链接
     * @param currentBusiness
     */
    public void addSelfLink(BusinessRelationDO currentBusiness, int level);

    /**
     * 添加顶级链接
     * @param currentBusiness
     */
    public void addRootLink(BusinessRelationDO currentBusiness);

    /**
     * 获取父级树列表
     * @param businessRelationDO
     * @param selfLinkFlag          是否需要增加自链接标志进行筛选,null 显示所有
     */
    public List<BusinessLink> selectParentTreeByBusinessRelationDO(BusinessRelationDO businessRelationDO, Boolean selfLinkFlag);



//    /**
//     * 精确查询业务链路列表,用于逻辑关联表处理
//     *
//     * @param businessLink 业务链路
//     * @return 业务链路集合
//     */
//    public List<BusinessLink> exactQueryBusinessLinkList(BusinessLink businessLink);



    /**
     * 新增业务链路
     *
     * @param businessLink 业务链路
     * @return 主键
     */
    public void insertBusinessLink(BusinessLink businessLink);

//
//    /**
//     * 修改业务链路
//     *
//     * @param businessLink 业务链路
//     * @return 结果
//     */
//    public int updateBusinessLink(BusinessLink businessLink);

    /**
     * 删除业务链路
     *
     * @param sourceBusiness
     * @return 结果
     */
    public int deleteBusinessLinkBySourceBusinessRelationDO(BusinessRelationDO sourceBusiness);

}
